<?php 
header("content-type:text/html;charset=07c");
$pdo = new PDO("mysql:host=127.0.0.1;dbname=07c","root","root");
$sql = "select * from store ";
// print_r($sql);
$data = $pdo->query($sql)->fetchAll(PDO::FETCH_ASSOC);
$starttime = $data[0]['starttime'];
$start = strtotime($starttime);
$time = $starttime-time();
$hour = floor($time/3600);
$min = floor(($time-$hour*3600)/60);
$sec = $time-$hour*3600-$min*60;

echo json_encode(array('hour'=>$hour,'min'=>$min,'sec'=>$sec));
 ?>